﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Janus.NorthwindDemo2007
{
    public partial class CategoryDataForm : Janus.NorthwindDemo2007.DataForm
    {        
        
        protected override void StartEdition()
        {
            this.categoryDataControl1.DataSource = this.DataSet;
            if (this.EditMode == DataFormEditMode.AddNew)
            {
                this.Text = "Loại sản phẩm - Tạo mới";
                this.categoryDataControl1.IsAddNew = true;
            }
            else
            {
                DataRowView dataRow = (DataRowView)CurrencyManager.Current;
                string empName = dataRow["CategoryName"].ToString();
                this.Text = "Loại sản phẩm - " + empName;
                this.categoryDataControl1.IsAddNew = false;
            }
            this.categoryDataControl1.Select();
        }

      

    }
}
